SET (PROJECTNAME Euler1d CACHE STRING "Project & Executable name")
PROJECT(${PROJECTNAME})

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wreturn-type -fopenmp")

AUX_SOURCE_DIRECTORY(. SOURCES)

ADD_EXECUTABLE(${PROJECTNAME} ${SOURCES})

ADD_CUSTOM_TARGET(remove_executable
COMMAND rm -f ${PROJECTNAME}
)
ADD_DEPENDENCIES(${PROJECTNAME} remove_executable)

SET( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/..")
INSTALL(TARGETS ${PROJECTNAME} 
DESTINATION . 
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
